"use strict"

/**
 * 天津市政府采购中心爬虫
 *  
 */

var Base = require("./base");
var tjs_spider = new Base();
tjs_spider.name = "天津市政府采购中心";

tjs_spider.getPageUrl = function (pg) {
    return "http://www.tjgp.gov.cn/portal/topicView.do?method=findbyfind&page=" + pg + "&name="; //%E7%A8%8E%E5%8A%A1
};

tjs_spider.getItems = function ($) {
    var items = [];
    $("h2 a").each(function (index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text();
        item.url = "http://www.tjgp.gov.cn" + e.attr("href");
        item.source = tjs_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = tjs_spider;